<?
	if (eregi("login.php",$PHP_SELF)){
     Header("Location: index.php");
     die();
    }
	session_start();
	require("koneksi.php");
	
	if($_POST['submit'])
	{
			$id=$_POST["id"];
			$pass=$_POST["pass"];
			
			$query=mysql_query("select count(*) from admin where id_admin='$id' and password ='$pass'");
			$row=mysql_fetch_row($query);
			if($row[0] == 1)
			{
				$_SESSION['id'] = $id;
				$_SESSION['pass'] = $pass;
				
				Header("Location:menu_admin.php");
			}
			else
			{
				Header("location:index.php");
			}
	}
	else
	{
		header("location:index.php");
	}
?>